HAL XSPI IO operation functions migration

This section provides information about the HAL XSPI I/O operation functions migration.

HAL XSPI IRQ handler function

HAL1

HAL2

HAL_XSPI_IRQHandler(XSPI_HandleTypeDef *hxspi);
HAL_XSPI_IRQHandler(hal_xspi_handle_t *hxspi);

HAL XSPI command configuration functions

HAL XSPI command

HAL1

HAL2

HAL_XSPI_Command(XSPI_HandleTypeDef *hxspi,
                 XSPI_RegularCmdTypeDef *const pCmd,
                 uint32_t Timeout);
HAL_XSPI_SendRegularCmd(hal_xspi_handle_t *hxspi,
                        const hal_xspi_regular_cmd_t *p_cmd,
                        uint32_t timeout_ms)

HAL XSPI command IT

HAL1

HAL2

HAL_XSPI_Command_IT(XSPI_HandleTypeDef *hxspi,
                    XSPI_RegularCmdTypeDef *const pCmd);
HAL_XSPI_SendRegularCmd_IT(hal_xspi_handle_t *hxspi,
                           const hal_xspi_regular_cmd_t *p_cmd)

HAL XSPI hyperbus configuration

HAL1

HAL2

HAL_XSPI_HyperbusCfg(XSPI_HandleTypeDef *hxspi,
                     XSPI_HyperbusCfgTypeDef *const pCfg,
                     uint32_t Timeout)
HAL_XSPI_SetConfig(hal_xspi_handle_t *hxspi,
                   const hal_xspi_config_t *p_config)

HAL XSP hyperbus command

HAL1

HAL2

HAL_XSPI_HyperbusCmd(XSPI_HandleTypeDef *hxspi,
                     XSPI_HyperbusCmdTypeDef *const pCmd,
                     uint32_t Timeout);
HAL_XSPI_SendHyperbusCmd(hal_xspi_handle_t *hxspi,
                         const hal_xspi_hyperbus_cmd_t *p_cmd,
                         uint32_t timeout_ms);

HAL XSPI indirect mode functions

HAL XSPI Transmit

HAL1

HAL2

HAL_XSPI_Transmit(XSPI_HandleTypeDef *hxspi,
                  const uint8_t *pData,
                  uint32_t Timeout);
HAL_XSPI_Transmit(hal_xspi_handle_t *hxspi,
                  const void *p_data,
                  uint32_t timeout_ms);

HAL XSPI receive

HAL1

HAL2

HAL_XSPI_Receive(XSPI_HandleTypeDef *hxspi,
                 uint8_t *const pData,
                 uint32_t Timeout);
HAL_XSPI_Receive(hal_xspi_handle_t *hxspi,
                 void *p_data,
                 uint32_t timeout_ms);

HAL XSPI transmit IT

HAL1

HAL2

HAL_XSPI_Transmit_IT(XSPI_HandleTypeDef *hxspi,
                     const uint8_t *pData);
HAL_XSPI_Transmit_IT(hal_xspi_handle_t *hxspi,
                     const void *p_data);

HAL XSPI receive IT

HAL1

HAL2

HAL_XSPI_Receive_IT(XSPI_HandleTypeDef *hxspi,
                    uint8_t *const pData);
HAL_XSPI_Receive_IT(hal_xspi_handle_t *hxspi,
                    void *p_data);

HAL XSPI transmit DMA

HAL1

HAL2

HAL_XSPI_Transmit_DMA(XSPI_HandleTypeDef *hxspi,
                      const uint8_t *pData);
HAL_XSPI_Transmit_DMA(hal_xspi_handle_t *hxspi,
                      const void *p_data);

HAL XSPI receive DMA

HAL1

HAL2

HAL_XSPI_Receive_DMA(XSPI_HandleTypeDef *hxspi,
                     uint8_t *const pData);
HAL_XSPI_Receive_DMA(hal_xspi_handle_t *hxspi,
                     void *p_data);

HAL XSPI status flag polling mode functions

HAL XSPI auto polling

HAL1

HAL2

HAL_XSPI_AutoPolling(XSPI_HandleTypeDef *hxspi,
                     XSPI_AutoPollingTypeDef *const pCfg,
                     uint32_t Timeout);
HAL_XSPI_ExecRegularAutoPoll(hal_xspi_handle_t *hxspi
                             const hal_xspi_auto_polling_config_t *p_config,
                             uint32_t timeout_ms);

HAL XSPI auto polling IT

HAL1

HAL2

HAL_XSPI_AutoPolling_IT(XSPI_HandleTypeDef *hxspi,
                        XSPI_AutoPollingTypeDef *const pCfg);
HAL_XSPI_ExecRegularAutoPoll_IT(hal_xspi_handle_t *hxspi,
                                const hal_xspi_auto_polling_config_t *p_config);

HAL XSPI memory-mapped mode functions

HAL XSPI memory mapped

HAL1

HAL2

HAL_XSPI_MemoryMapped(XSPI_HandleTypeDef *hxspi,
                      XSPI_MemoryMappedTypeDef *const pCfg);
HAL_XSPI_StartMemoryMappedMode(hal_xspi_handle_t *hxspi,
                               const hal_xspi_memory_mapped_config_t *p_config)

HAL XSPI IO manager configuration function

HAL XSPIM config

HAL1

HAL2

HAL_XSPIM_Config(XSPI_HandleTypeDef *const hxspi,
                 XSPIM_CfgTypeDef *const pCfg
                 uint32_t Timeout);
HAL_XSPI_XSPIM_SetConfig(const hal_xspi_xspim_config_t *p_config);

Example usage

HAL1

HAL2

XSPI_HandleTypeDef hxspi1;
XSPIM_CfgTypeDef sXspiManagerCfg;

/* Configure port 1 */
sXspiManagerCfg.nCSOverride = HAL_XSPI_CSSEL_OVR_NCS1;
sXspiManagerCfg.IOPort = HAL_XSPIM_IOPORT_1;
HAL_XSPIM_Config(&hxspi1, &sXspiManagerCfg, HAL_XSPI_TIMEOUT_DEFAULT_VALUE);



/* Configure port 2 */
sXspiManagerCfg.nCSOverride = HAL_XSPI_CSSEL_OVR_NCS1;
sXspiManagerCfg.IOPort = HAL_XSPIM_IOPORT_2;
HAL_XSPIM_Config(&hxspi1, &sXspiManagerCfg, HAL_XSPI_TIMEOUT_DEFAULT_VALUE);
hal_xspi_xspim_config_t sOspiManagerCfg;


/* Configure the OCTOSPIM port 1 */
sOspiManagerCfg.port1.clk = HAL_XSPI_XSPIM_XSPI1;
sOspiManagerCfg.port1.dqs = HAL_XSPI_XSPIM_XSPI1;
sOspiManagerCfg.port1.ncs = HAL_XSPI_XSPIM_XSPI1;
sOspiManagerCfg.port1.io_low = HAL_XSPI_XSPIM_XSPI1_IO_LOW;
sOspiManagerCfg.port1.io_high = HAL_XSPI_XSPIM_XSPI1_IO_HIGH

/* Configure the OCTOSPIM port 2 */
sOspiManagerCfg.port2.clk = HAL_XSPI_XSPIM_XSPI2;
sOspiManagerCfg.port2.dqs = HAL_XSPI_XSPIM_XSPI2;
sOspiManagerCfg.port2.ncs = HAL_XSPI_XSPIM_XSPI2;
sOspiManagerCfg.port2.io_low = HAL_XSPI_XSPIM_XSPI2_IO_LOW;
sOspiManagerCfg.port2.io_high = HAL_XSPI_XSPIM_XSPI2_IO_HIGH;

HAL_XSPI_XSPIM_SetConfig(&sOspiManagerCfg);